package com.gigi.controller;

import com.alibaba.cola.dto.MultiResponse;
import com.alibaba.cola.dto.Response;
import com.gigi.entity.LikeShiqinEntity;
import com.gigi.model.LikeDO;
import com.gigi.model.ListFavoriteRequest;
import com.gigi.service.manual.LikeManageService;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 点赞管理
 */
@RestController
@RequestMapping("like-manage")
public class LikeManageController {

    private final LikeManageService likeManageService;

    public LikeManageController(LikeManageService likeManageService) {
        this.likeManageService = likeManageService;
    }

    @ApiOperation(value = "列表")
    @PostMapping("/list")
    public MultiResponse<LikeShiqinEntity> list(@RequestBody ListFavoriteRequest request) {
        return likeManageService.list(request);
    }

    @ApiOperation(value = "新增/删除")
    @PostMapping("/change")
    public Response change(@RequestBody LikeDO request) {
        return likeManageService.change(request);
    }

}
